function loadcomponents(name) {
    return resolve => require([`@/components/${name}`], resolve);
}
function loadviews(name) {
    return resolve => require([`@/views/${name}`], resolve);
}
const routes = [
    {
        path: "/",
        name:'home',
        redirect:'/login'
    },
    {
        path: "/translist",
        name:'translist',
        component:loadviews('translist/index'),
        meta: {
            title: '运输列表',
            keepAlive:true
        }
    },
    {
        path: "/transdetail",
        name:'transdetail',
        component:loadviews('translist/detail'),
        meta: {
            title: '托运详情'
        }
    },
    {
        path: "/attachupload",
        name:'attachupload',
        component:loadviews('attach/attachupload'),
        meta: {
            title: '附件上传'
        }
    },
    {
        path: "/queryfee",
        name:'queryfee',
        component:loadviews('queryfee/index'),
        meta: {
            title: '运费查询'
        }
    },
    {
        path: "/login",
        name:'login',
        component:loadviews('user/login'),
        meta: {
            title: '账号绑定'
        }
    },
    {
        path: "/profile",
        name:'profile',
        component:loadviews('user/profile'),
        meta: {
            title: '个人信息'
        }
    },
    {
        path: '/pageMissing',
        component: loadcomponents('public/Error'),
        meta: {
            title: '页面搞丢了'
        }
    },
    {
        path: '*',
        redirect:'/pageMissing'
    }
];
export default routes;